package com.yjc.drygoods.product.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.yjc.common.utils.PageUtils;
import com.yjc.drygoods.product.entity.SkuInfoEntity;
import com.yjc.drygoods.product.entity.SpuInfoEntity;
import com.yjc.drygoods.product.vo.EChartsAttentionCountVo;
import com.yjc.drygoods.product.vo.EChartsSaleCountVo;
import com.yjc.drygoods.product.vo.SkuItemVo;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutionException;

/**
 * sku信息
 *
 * @author yjc
 * @email yjc19979401754@126.com
 * @date 2022-08-19 21:27:48
 */
public interface SkuInfoService extends IService<SkuInfoEntity> {

    PageUtils queryPage(Map<String, Object> params);

    void saveBatchSkuInfos(List<SkuInfoEntity> skuInfoEntities);

    void saveSkuInfos(SkuInfoEntity skuInfoEntity);

    PageUtils queryPageByCondition(Map<String, Object> params);


    List<SkuInfoEntity> getSkuInfosBySpuId(Long spuId);

    List<SkuInfoEntity> getAllSkuInfo();

    SkuItemVo item(Long skuId) throws ExecutionException, InterruptedException;

    /**
     * 通过skuId查找所属spu信息
     * @param skuId
     * @return
     */
    SpuInfoEntity getSpuInfoBySkuId(Long skuId);

    void updateSkuSaleCount(List<SkuInfoEntity> skuInfos);

    List<SkuInfoEntity> getBatchSkuInfo(List<Long> skuIds);

    void updateAttentionCount(Map<String,Object> params);

    void updateReducedPrice(Long spuId, BigDecimal reducedPrice);

    void updateSkuInfoPrice(BigDecimal price,Long skuId);

    Map<String, List<EChartsSaleCountVo>> getSevenFiveDrygoods() throws ExecutionException, InterruptedException;

    Map<String, List<EChartsAttentionCountVo>> getTwoYearAttentions() throws ExecutionException, InterruptedException;
}

